<template>
  <div>
    <el-container>
      <el-aside width="200px">
        <el-col>
          <el-menu
            router
            text-color="#f8f5f5"
            background-color="#545c64"
            default-active="1-2"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>数据管理</span>
              </template>

              <el-menu-item route="Usertable" index="1-1">
                用户列表
              </el-menu-item>
              <el-menu-item index="1-2" route="Shoptable"
                >商家列表</el-menu-item
              >
              <el-menu-item index="1-3" route="/">食品列表</el-menu-item>
            </el-submenu>
            <el-menu-item index="2">
              <i class="el-icon-menu"></i>
              <span slot="title">添加数据</span>
            </el-menu-item>
            <el-menu-item index="3">
              <i class="el-icon-document"></i>
              <span slot="title">图表数据</span>
            </el-menu-item>
            <el-menu-item index="4">
              <i class="el-icon-setting"></i>
              <span slot="title">信息编辑</span>
            </el-menu-item>
          </el-menu>
        </el-col>
      </el-aside>
      <el-container>
        <el-header>
          <div style="width:100%;height:3vh"></div>
          <el-breadcrumb separator="/">
            <el-breadcrumb-item :to="{ path: '/' }"
              >数据管理</el-breadcrumb-item
            >
            <el-breadcrumb-item
              ><a href="/Shoptable">商家列表</a></el-breadcrumb-item
            >
            <el-breadcrumb-item
              ><a href="/Usertable">用户列表</a></el-breadcrumb-item
            >
            <el-breadcrumb-item>食品列表</el-breadcrumb-item>
          </el-breadcrumb>
        </el-header>

        <router-view />
         
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath)
    },
  },
  
}
</script>

<style>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color:#545c64;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
